P32A 001000 |
rt |
rs |
ac |
EXTRV.W 00 |
111 |
010 |
111 |
111 |
P32A 001000 |
rt |
rs |
ac |
EXTRV_R.W 01 |
111 |
010 |
111 |
111 |
P32A 001000 |
rt |
rs |
ac |
EXTRV_RS.W 10 |
111 |
010 |
111 |
111 |
6 |
5 |
5 |
2 |
2 |
3 |
3 |
3 |
3 |
EXTRV[_RS].W |
Extract Word Value With Variable Right Shift From Accumulator to GPR | |
EXTRV.W rt, ac, rs |
DSP |
Extract Word Value With Variable Right Shift From Accumulator to GPR |
EXTRV_R.W rt, ac, rs |
DSP |
Extract Word Value With Variable Right Shift From Accumulator to GPR |
EXTRV_RS.W rt, ac, rs |
DSP |
Extract Word Value With Variable Right Shift From Accumulator to GPR |
Extract Word Value With Variable Right Shift From Accumulator to GPR
Extract a word value from a 64-bit accumulator to a GPR with variable right shift, and with optional rounding or rounding and saturation.
rt = sat32(round(ac >> rs5..0))
The value in accumulator ac is shifted right by shift bits with sign extension (arithmetic shift right). The lower 32 bits of the shifted value are then written to the destination register rt. The number of bits to shift is given by the five leastsignificant bits of register rs; the remaining bits of rs are ignored.
The rounding variant of the instruction adds a 1 at the most-significant discarded bit position. The 32 least-significant bits of the rounded result are then written to the destination register.
The rounding and saturating variant of the i nstruction adds a 1 at the most-significant discarded bit position. If the rounding operation results in an overflow, the shifted value is clamped to the maximum positive Q31 fractional value
(0x7FFFFFFF hexadecimal). The rounded and saturated result is then written to the destination register.
The value of ac can range from 0 to 3. When ac=0, this refers to the original HI/LO register pair of the MIPS32 architecture. After the execution of this instruction, ac remains unmodified.
For all variants of the instruction, including EXTRV.W, bit 23 of th e DSPControl register is set to 1 if either of the rounded or non-rounded calculation results in overflow or saturation.
No data-dependent exceptions are possible.
The operands must be values in the specified format. If they are not, the results are UNPREDICTABLE and the values of the operand vectors become UNPREDICTABLE.
EXTRV.W ValidateAccessToDSPResources() temp64..0 = _shiftShortAccRightArithmetic( ac, GPR[rt]4..0 ) if (( temp64..32 != 0 ) and ( temp64..32 != 0x1FFFFFFFF )) then DSPControlouflag:23 = 1 endif GPR[rt]31..0 = temp32..1 temp64..0 = temp + 1 DSPControlouflag:23 = 1 endif EXTRV_R.W ValidateAccessToDSPResources() temp64..0 = _shiftShortAccRightArithmetic( ac, GPR[rt]4..0 ) if (( temp64..32 != 0 ) and ( temp64..32 != 0x1FFFFFFFF )) then DSPControlouflag:23 = 1 endif temp64..0 = temp + 1 if (( temp64..32 != 0 ) and ( temp64..32 != 0x1FFFFFFFF )) then DSPControlouflag:23 = 1 endif GPR[rt]31..0 = temp32..1 EXTRV_RS.W ValidateAccessToDSPResources() temp64..0 = _shiftShortAccRightArithmetic( ac, GPR[rt]4..0 ) if (( temp64..32 != 0 ) and ( temp64..32 != 0x1FFFFFFFF )) then DSPControlouflag:23 = 1 endif temp64..0 = temp + 1 if (( temp64..32 != 0 ) and ( temp64..32 != 0x1FFFFFFFF )) then if ( temp64 = 0 ) then temp32..1 = 0x7FFFFFFF else temp32..1 = 0x80000000 endif DSPControlouflag:23 = 1 endif GPR[rt]31..0 = temp32..1
Reserved Instruction, DSP Disabled